package com.holly.unit.bpmn.modular.activiti.adapter;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.holly.unit.auth.api.pojo.login.LoginUser;
import com.holly.unit.bpmn.api.pojo.BpmnUser;

/**
 * 类描述: 适配器类 把LoginUser转化成BpmnUser 提供给Activiti使用
 *
 * @author fxr
 * @version 1.0.0
 * @date 2022/3/8 14:41
 */
public class LoginUserToBpmnUser {

    public static BpmnUser convert(LoginUser loginUser) {
        if (ObjectUtil.isEmpty(loginUser)) return null;
        BpmnUser bpmnUser = new BpmnUser();
        BeanUtil.copyProperties(loginUser,bpmnUser,false);
        return bpmnUser;
    }
}
